package com.hippy.erya.config.properties;

import com.hippy.erya.sys.core.constant.cache.Cache;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

import java.util.Objects;


public class LinuxCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        /*String[] activeProfiles = context.getEnvironment().getActiveProfiles();
        if (!Cache.PRD_PROFILE.equals(activeProfiles[0])) {
            return false;
        }
        return Objects.requireNonNull(context.getEnvironment().getProperty(Cache.OS_NAME)).
                contains(Cache.OS_NAME_LINUX) ||
                Objects.requireNonNull(context.getEnvironment().getProperty(Cache.OS_NAME)).
                        contains(Cache.OS_NAME_MAC);*/
        return false;
    }
}
